package com.yanyi.music.dao;

import com.yanyi.music.domain.Collect;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 收藏Dao
 */
@Repository
public interface CollectMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Collect record);

    int insertSelective(Collect record);

    Collect selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Collect record);

    int updateByPrimaryKey(Collect record);
    /**
     * 查询所有收藏
     */
    List<Collect> findAll(Map<String,Object> map);

    /**
     * 查询某个用户是否已经收藏了某个歌曲
     */
    int existSongId(Integer userId, Integer songId);
    /**
     * 根据用户id和歌曲id删除
     */
    int deleteByUserIdSongId(@Param("userId") Integer userId, @Param("songId") Integer songId);
}